import { get, post } from '@/utils/http/axios';
enum URL {
  chat = '/api/chat',
  test= '/api/chat/',
  result = '/api/chat/json'
}

export interface ChatRes {
  response: string;
  history: string[];
  status: string;
  time: string;
}
export interface ChatData {
  prompt: string;
  history:string[]
}
export interface ChatJson {
  prompt: string;
}
export const chatToModel = async (data: ChatData) => post<ChatRes| any>({ url: URL.chat, data });
export const test = async (data:string) => get<any>({ url: URL.test + data });
export const getJsonResult = async(data:ChatJson) => post<any>({url:URL.result,data})
